require './Modele/Parking'
require './Modele/Voiturier'
require './Modele/Client'
require './Modele/Client_garanti'
require './Modele/Abonne'
require './Modele/Vehicule'
require './Modele/Dbconect'
require 'sqlite3' 

parking = Parking.new("mabase",3,4)
db = SQLite3::Database.new("mabase.db")
p db.execute2("select * from Places")
p db.execute2("select * from Vehicules")
p db.execute2("select * from Livraisons")
p db.execute2("select * from Clients")
p db.execute2("select * from Parkings")
client = Abonne.new("Fobert","Jean-michel",parking)
vehicule= Vehicule.new("123ABC31",1.5,3.2)
client2 = Client.new("Uonyr","Robert",parking)
vehicule2= Vehicule.new("123ABC75",1.5,3.2)
client3 = Client.new("Corena","Patrick",parking)
vehicule3= Vehicule.new("123ABC76",1.5,3.2)
client4 = Client.new("Koren","Jean-pierre",parking)
vehicule4= Vehicule.new("123ABC70",1.5,3.2)
voiturier = Voiturier.new("gdfgdfn","Jean-pierre",parking)
puts client.se_garer(vehicule,parking.acces[0].borne)
client.demander_livraison(parking,vehicule,"18/12/2012 18h00","14 rue Lebaron Toulouse")
puts client2.se_garer(vehicule2,parking.acces[1].borne)
puts client3.se_garer(vehicule3,parking.acces[0].borne)
puts client4.se_garer(vehicule4,parking.acces[0].borne)
puts "Entrez le numero du ticket de la place de parking :"
ticket = gets.chomp
puts client3.reprendre_vehicule(ticket,parking.acces[1].borne)
puts client4.se_garer(vehicule4,parking.acces[0].borne)
puts voiturier.livrer_voiture(vehicule)
p db.execute2("select * from Places")
p db.execute2("select * from Vehicules")
p db.execute2("select * from Livraisons")
p db.execute2("select * from Clients")
p db.execute2("select * from Parkings")

